home *** CD-ROM | disk | FTP | other *** search
- global gMasterData, gSliderScores, gViewSet
-
- on goPRintro
- go("PRintro")
- setUserArea(gMasterData, #resources1)
- end
-
- on audioPR
- goNarrator(gMasterData, "18")
- end
-
- on goPersonal
- global gSliderScores, gViewSet
- go("sliders")
- goNarrator(gMasterData, "19")
- setUserArea(gMasterData, #resources2)
- set gViewSet to 1
- if voidp(gSliderScores) then
- set gSliderScores to [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
- else
- setSliders()
- end if
- end
-
- on clearSliders
- setPuppetState([5, 16], #c, 0)
- end
-
- on goBackInPR
- go(label("sliders") + 1)
- set vTitleSprite to 5
- set vArtSprite to 6
- setPuppetState([vTitleSprite, vArtSprite], #n, 1)
- set the member of sprite vArtSprite to member "resources 2"
- set the loc of sprite vTitleSprite to point(320, 240)
- setSliders()
- setUserArea(gMasterData, #resources2)
- end
-
- on moveSlider thisSprite
- set vMinHz to 404
- set vMaxHz to 568
- set vVertPos to the locV of sprite thisSprite
- puppetSprite(thisSprite, 1)
- set vNewLocH to vMinHz
- repeat while the mouseDown
- set vPlotLoc to the mouseH
- case 1 of
- (vPlotLoc < vMinHz):
- set the loc of sprite thisSprite to point(vMinHz, vVertPos)
- set vNewLocH to vMinHz
- (vPlotLoc > vMaxHz):
- set the loc of sprite thisSprite to point(vMaxHz, vVertPos)
- set vNewLocH to vMaxHz
- otherwise:
- set the loc of sprite thisSprite to point(the mouseH, vVertPos)
- set vNewLocH to vPlotLoc
- end case
- updateStage()
- end repeat
- puppetSound("quickclick")
- set vDivDistance to 164.0 / 9
- set vDivNumber to integer(1.0 * (vNewLocH - 404) / vDivDistance)
- set snapPointH to integer(vDivNumber * vDivDistance) + 404
- set the loc of sprite thisSprite to point(snapPointH, vVertPos)
- scoreSlider(thisSprite, vDivNumber)
- end
-
- on scoreSlider thisSprite, userChoice
- setAt(getAt(gSliderScores, gViewSet), thisSprite - 6, userChoice + 1)
- end
-
- on switchSet
- repeat with thisOne = 1 to 10
- if getAt(getAt(gSliderScores, gViewSet), thisOne) = 0 then
- alert("Please select a score for each of the personal resources before proceeding.")
- exit
- end if
- end repeat
- set vTitleSprite to 5
- set vArtSprite to 6
- setPuppetState([vTitleSprite, vArtSprite], #n, 1)
- case gViewSet of
- 1:
- set gViewSet to 2
- set the member of sprite vArtSprite to member "resources 2"
- set the loc of sprite vTitleSprite to point(320, 240)
- 2:
- set gViewSet to 1
- set the member of sprite vArtSprite to member "resources 1"
- set the loc of sprite vTitleSprite to point(-2222, -2222)
- end case
- setSliders()
- end
-
- on setSliders
- set vDivDistance to 164.0 / 9
- repeat with thisOne = 1 to 10
- set thisSprite to thisOne + 6
- set thisAnswer to getAt(getAt(gSliderScores, gViewSet), thisOne)
- set vVertPos to the locV of sprite thisSprite
- if thisAnswer = 0 then
- puppetSprite(thisSprite, 0)
- next repeat
- end if
- puppetSprite(thisSprite, 1)
- set snapPointH to integer((thisAnswer - 1) * vDivDistance) + 404
- set the loc of sprite thisSprite to point(snapPointH, vVertPos)
- end repeat
- updateStage()
- end
-
- on slidersDone
- global checkMarks1
- repeat with thisOne = 1 to 10
- if getAt(getAt(gSliderScores, gViewSet), thisOne) = 0 then
- alert("Please select a score for each of the personal resources before proceeding.")
- exit
- end if
- end repeat
- if getaProp(checkMarks1, #resources) = 0 then
- setaProp(checkMarks1, #resources, 1)
- end if
- clearSliders()
- repeat with xField in ["PR results", "PR rankings"]
- set the text of member xField to " "
- set the textFont of member xField to "Palatino"
- set the textSize of member xField to 12
- set the textHeight of member xField to 14
- end repeat
- go("PRresult")
- scoresToText()
- goNarrator(gMasterData, "20")
- setUserArea(gMasterData, #resources3)
- end
-
- on scoresToText
- set vResultList to []
- repeat with vSubList = 1 to count(gSliderScores)
- repeat with X in getAt(gSliderScores, vSubList)
- add(vResultList, X)
- end repeat
- end repeat
- set vResultString to EMPTY
- set vResultRanks to EMPTY
- set vAnswerFind to 10
- repeat while vAnswerFind > 0
- repeat with vListPos = 1 to count(vResultList)
- if getAt(vResultList, vListPos) = vAnswerFind then
- put line vListPos of the text of member "PR categories" & RETURN after vResultString
- put string(getAt(vResultList, vListPos)) & RETURN after vResultRanks
- end if
- end repeat
- set vAnswerFind to vAnswerFind - 1
- end repeat
- set the text of member "PR results" to vResultString
- set the text of member "PR rankings" to vResultRanks
- end
-